<?php
defined('IN_XLP') or exit('Access Denied');
$Document = array(
    'pageid'   => 'seller-add', //页面标示
    'pagename' => '添加商户', //当前页面名称
    'mycss'    => array(), //加载的css样式表
    'myjs'     => array(), //加载的js脚本
    'footerjs' => array(),
    'head'     => true, //加载头部文件
);

include getTpl('header', 'public');
?>
<style>
label{cursor:pointer;font-weight:normal}
.pt7{padding-top:7px;}
</style>
<!--顶部导航 开始-->
<?php include getTpl('top', 'public');?>
<!--顶部导航 结束-->
<!--左侧菜单 开始-->
<?php include getTpl('nav', 'public');?>
<!--左侧菜单 结束-->
<!--主体 开始-->
<!-- content -->
<section id="content">
    <section class="main padder">
        <div class="clearfix">
            <h4><i class="fa fa-edit"></i>新增商户</h4>
        </div>
        <div class="row">
            <div class="col-sm-12">
                <section class="panel">
                    <div class="panel-body">
                        <form class="form-horizontal" id="sellerAddForm" method="post" autocomplete="off">
                            
                            <div class="form-group">
                                <label class="col-sm-1 control-label">商户UID</label>
                                <div class="col-sm-1">
                                    <input type="number" name="uid" id="uid" placeholder="UID" class="form-control" />
                                </div>
                            </div>
                            
                            <div class="form-group">
                                <label class="col-sm-1 control-label">姓&emsp;&emsp;名</label>
                                <div class="col-sm-2">
                                    <input type="text" name="seller_name" id="seller_name" placeholder="姓名" class="form-control" />
                                </div>
                            </div>

                            <div class="form-group">
                                <label class="col-sm-1 control-label">商户名称</label>
                                <div class="col-sm-2">
                                    <input type="text" name="seller_shop" id="seller_shop" placeholder="商户名称" class="form-control" />
                                </div>
                            </div>

                            <div class="form-group">
                                <label class="col-sm-1 control-label">商户电话</label>
                                <div class="col-sm-2">
                                    <input type="text" name="seller_phone" id="seller_phone" placeholder="商户电话" class="form-control" />
                                </div>
                            </div>

                            <div class="form-group">
                                <label class="col-sm-1 control-label">商户地址</label>
                                <div class="col-sm-3">
                                    <input type="text" name="seller_addr" id="seller_addr" placeholder="100字以内" class="form-control" value="">
                                </div>
                            </div>

                            <br>
                            <div class="form-group">
                                <label class="col-sm-1 control-label red">支付方式三选一：</label>
                            </div>

                            <div class="form-group">
                                <label class="col-sm-1 control-label">银行卡号</label>
                                <div class="col-sm-2">
                                    <input type="text" name="bank_card_num" id="bank_card_num" placeholder="银行卡号" class="form-control" />
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-1 control-label">持卡人姓名</label>
                                <div class="col-sm-2">
                                    <input type="text" name="bank_card_holder" id="bank_card_holder" placeholder="持卡人姓名" class="form-control" />
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-1 control-label">开户行</label>
                                <div class="col-sm-3">
                                    <input type="text" name="bank_name" id="bank_name" placeholder="开户银行信息" class="form-control" />
                                </div>
                            </div>
                            
                            <br>

                            <div class="form-group">
                                <label class="col-sm-1 control-label">支付宝</label>
                                <div class="col-sm-3">
                                    <input type="text" name="alipay" id="alipay" placeholder="支付宝" class="form-control" />
                                </div>
                            </div>
                            
                            <br>

                            <div class="form-group">
                                <label class="col-sm-1 control-label">财付通</label>
                                <div class="col-sm-3">
                                    <input type="text" name="tenpay" id="tenpay" placeholder="财付通" class="form-control" />
                                </div>
                            </div>
                            
                            <div class="form-group">
                                <label class="col-sm-1 control-label">是否通过审核</label>
                                <div class="col-sm-2 pt7">
                                    <input id="is_pass" type="radio" name="passed" value="0" checked />
                                    <label for="is_pass">未通过</label>&emsp;&emsp;
                                    <input id="not_pass" type="radio" name="passed" value="1" />
                                    <label for="not_pass">通过</label>
                                </div>
                            </div>


                            <div class="form-group pt7">
                                <div class="col-sm-9 col-lg-offset-1">
                                    <div class="col-sm-1">
                                        <button type="submit" id="sub-ok" data-loading-text="正在提交..." class="btn btn-primary">保存</button>
                                    </div>
                                    <button type="button" class="btn btn-white">取消</button>
                                </div>
                            </div>

                        </form>
                    </div>
                </section>
            </div>
        </div>
    </section>
</section>
<!--/ content --> 
<!--主体 结束-->
<script>
$(function(){

    $('#sellerAddForm').submit(function(){
        if( $.trim($('#seller_name').val()) == '' ) {
            Msg.error('请输入商户名称');
            resetSubmit("#sub-ok",'提交');
            return false;
        }
        if( $.trim($('#seller_phone').val()) == '' ) {
            Msg.error('请输入商户电话');
            resetSubmit("#sub-ok",'提交');
            return false;
        }

        Msg.loading();
        $.post('<?php echo U("seller/add"); ?>', $(this).serialize(), function(result){
            Msg.hide();
            resetSubmit("#sub-ok",'提交');
            if(result.status == 1) {
                Msg.ok(result.info);
            } else {
                Msg.error(result.info);
            }
        }, 'JSON');
        return false;
    });
});
</script>
<?php include getTpl('footer', 'public'); ?>